package com.briup.day05;

import java.util.Arrays;

public class Test_Arrays {
    public static void main(String[] args) {
        int[] arr={1,9,5,7,2};
        System.out.println(Arrays.toString(arr));
//        arr=Arrays.copyOf(arr,10);
//        System.out.println(Arrays.toString(arr));
        //3.sort
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));
        //4.二分查找 根据有序数列进行查找
        int[] arr1={1,2,5,7,8,9,23};
        System.out.println(Arrays.binarySearch(arr1,7));
        //5.数组填充 将每个数组元素填充为指定的值
        Arrays.fill(arr1,100);
        System.out.println(Arrays.toString(arr1));
    }
}
